
import { useEffect, useState } from "react";
import classNames from 'classnames';
import './login.scss'

import LoginPanel from "@/components/Login";
import RegisterPanel from "@/components/Register";


function Login(){
  const [currentTab,setCurrentTab] = useState(1);
  
  

  const handleClick = (type:number) => {
    setCurrentTab(type);
  }


  

  return <div className="page login">
        <div className="login-container">
            <div className="login-tab">
              <div  onTouchStart={() => handleClick(1)} className={classNames('title login-title',{active:currentTab === 1})}>登录</div>
              <div  onTouchStart={() => handleClick(2)} className={classNames('title register-title',{active:currentTab === 2})} >注册</div>
            </div>
           {
            currentTab === 1 ? <LoginPanel /> : <RegisterPanel />
           }
        </div>
       
  </div>;
}

export default Login;